package com.jcl.traffic.system.service.impl;

import com.jcl.traffic.system.domain.BreakRule;
import com.jcl.traffic.system.repository.BreakRuleRepository;
import com.jcl.traffic.system.service.BreakRuleService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jcl_hqu
 * @date 2021/3/8 16:45
 */
@Service
@RequiredArgsConstructor
public class BreakRuleServiceImpl implements BreakRuleService {
    private final BreakRuleRepository breakRuleRepository;
    public List<BreakRule> listBreakRule(){
        return breakRuleRepository.findAll();
    }

    @Override
    public boolean deleteBreakRule(Long id) {
        breakRuleRepository.deleteById(id);
        return true;
    }
}
